﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using MahApps.Metro.Controls;

namespace HotTopicWinUi
{
    /// <summary>
    /// PeriodTableWindow.xaml 的交互逻辑
    /// </summary>
    public partial class PeriodTableWindow : MetroWindow
    {
        public PeriodTableWindow()
        {
            InitializeComponent();
            InitTableView();

        }


        private void InitTableView()
        {
            for (int i = 0; i < 12; i++)
            {
                var columnDefinition = new ColumnDefinition();
                this.TableBody.ColumnDefinitions.Add(columnDefinition);
                if(i==0)
                {
                    columnDefinition.Width = new GridLength(110);
                }
            }

            for (int i = 0; i < 3; i++)
            {
                var rowDefinition = new RowDefinition();
                this.TableBody.RowDefinitions.Add(rowDefinition);
            }
            
            for (int i = 0; i < 12; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    var textBlock = new TextBlock();
                    var solidColorBrush = new SolidColorBrush();
                    textBlock.Background = Brushes.Red;
                    textBlock.SetValue(Grid.RowProperty,j);
                    textBlock.SetValue(Grid.ColumnProperty,i);
                    this.TableBody.Children.Add(textBlock);
                }
            }
        }

    }
}
